/*
 *  Project     : QKeyboardStatistic
 *  Author      : Durachenko Aleksey V. <durachenko.aleksey@gmail.com>, 2011
 *  Licence     : GNU GENERAL PUBLIC LICENSE Version 2
 */
#ifndef CHOOKTHREAD_H
#define CHOOKTHREAD_H

#include <QObject>
#include <QEvent>
#include <windows.h>
#include "global.h"

class CHookThread : public QObject
{
Q_OBJECT
public:
    CHookThread(bool spyKeyboard, bool spyMouse, QObject* eventProcessor, QObject* parent = 0);
    ~CHookThread();

private:
#ifdef WIN32
    static LRESULT CALLBACK LLKeyboardProcWrapper(int nCode, WPARAM wParam, LPARAM lParam);
    static LRESULT CALLBACK LLMouseProcWrapper(int nCode, WPARAM wParam, LPARAM lParam);
#else
#warning the current platform not supported
#endif

private:
    static QObject* mEventProcessor;
#ifdef WIN32
    HHOOK mKeyHook;
    HHOOK mMouseHook;
#else
#warning the current platform not supported
#endif

};

#endif
